
package Chapter2.Comparing.c2;
import java.util.UUID;

public class Bank {
    /*public static String account;
    public static String password;
    public static double balance;*/
    public static double interestRate = 0.1;
    public static double minBlance = 2;
    private String account;
    private String password;
    private double balance;

    /*public static String getAccount() {
        return account;
    }

    public static void setAccount(String account) {
        Bank.account = account;
    }

    public static String getPassword() {
        return password;
    }

    public static void setPassword(String password) {
        Bank.password = password;
    }

    public static double getBalance() {
        return balance;
    }

    public static void setBalance(double balance) {
        Bank.balance = balance;
    }*/

    public static double getInterestRate() {
        return interestRate;
    }

    public static void setInterestRate(double interestRate) {
        Bank.interestRate = interestRate;
    }

    public static double getMinBlance() {
        return minBlance;
    }

    public static void setMinBlance(double minBlance) {
        Bank.minBlance = minBlance;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public double getBalance() {
        return balance;
    }

    public void setBalance(double balance) {
        this.balance = balance;
    }

    public static String uuid() {
        //int machineId = 1;  //最大支持1-9个集群机器部署
        int hashCodeV = UUID.randomUUID().toString().hashCode();
        if (hashCodeV < 0) {//有可能是负数
            hashCodeV = -hashCodeV;
        }
        return /*machineId + */String.format("%011d", hashCodeV);
    }

}
